package com.xzz.mybatis.generator.common;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class MyBaseEntity implements Serializable {

    public static final String CREATED_UPPERCASE_FILED = "CREATED";
    public static final String CREATE_USER_UPPERCASE_FIELD = "CREATE_USER";
    public static final String LAST_UPDATED_UPPERCASE_FIELD = "LAST_UPDATED";
    public static final String LAST_UPDATE_USER_UPPERCASE_FIELD = "LAST_UPDATE_USER";

    public static final String CREATED_LOWERCASE_FILED = "created";
    public static final String CREATE_USER_LOWERCASE_FIELD = "create_user";
    public static final String LAST_UPDATED_LOWERCASE_FIELD = "last_updated";
    public static final String LAST_UPDATE_USER_LOWERCASE_FIELD = "last_update_user";


    @TableField(fill = FieldFill.INSERT)
    private Date created;

    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date lastUpdated;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String lastUpdateUser;
}